package com.spic.business.ioc.service.impl;

import com.spic.business.common.core.utils.DateUtil;
import com.spic.business.ioc.domain.IocGoodDays;
import com.spic.business.ioc.mapper.IocGoodDaysMapper;
import com.spic.business.ioc.service.IIocGoodDaysService;
import com.spic.common.core.utils.UUIDUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 优良天数IOCService业务层处理
 *
 * @author spic
 * @date 2022-04-14
 */
@Service
public class IocGoodDaysServiceImpl implements IIocGoodDaysService
{
    @Autowired
    private IocGoodDaysMapper iocGoodDaysMapper;

    /**
     * 查询优良天数IOC
     *
     * @param id 优良天数IOC主键
     * @return 优良天数IOC
     */
    @Override
    public IocGoodDays selectIocGoodDaysById(String id)
    {
        return iocGoodDaysMapper.selectIocGoodDaysById(id);
    }

    /**
     * 查询优良天数IOC列表
     *
     * @param iocGoodDays 优良天数IOC
     * @return 优良天数IOC
     */
    @Override
    public List<IocGoodDays> selectIocGoodDaysList(IocGoodDays iocGoodDays)
    {
        return iocGoodDaysMapper.selectIocGoodDaysList(iocGoodDays);
    }

    /**
     * 新增优良天数IOC
     *
     * @param iocGoodDays 优良天数IOC
     * @return 结果
     */
    @Override
    public int insertIocGoodDays(IocGoodDays iocGoodDays)
    {
        String uuid = UUIDUtil.createUUID();
        iocGoodDays.setId(uuid);
        return iocGoodDaysMapper.insertIocGoodDays(iocGoodDays);
    }

    /**
     * 修改优良天数IOC
     *
     * @param iocGoodDays 优良天数IOC
     * @return 结果
     */
    @Override
    public int updateIocGoodDays(IocGoodDays iocGoodDays)
    {
        return iocGoodDaysMapper.updateIocGoodDays(iocGoodDays);
    }

    /**
     * 批量删除优良天数IOC
     *
     * @param ids 需要删除的优良天数IOC主键
     * @return 结果
     */
    @Override
    public int deleteIocGoodDaysByIds(String[] ids)
    {
        return iocGoodDaysMapper.deleteIocGoodDaysByIds(ids);
    }

    /**
     * 删除优良天数IOC信息
     *
     * @param id 优良天数IOC主键
     * @return 结果
     */
    @Override
    public int deleteIocGoodDaysById(String id)
    {
        return iocGoodDaysMapper.deleteIocGoodDaysById(id);
    }

    /**
     * @return 优良天数数据
     */
    @Override
    public List<Map<String, Object>> getGoodDays()
    {
        return null;
    }

    /**
     * @return 获取最近6年集合列表
     */
    @Override
    public List<Map<String,Object>> getYear()
    {

        return DateUtil.GetYears();
    }
}
